<script  src="/assets/js/jquery.min.js"></script>
<form id="add-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">

  <!--  <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Class_attr_id')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-class_attr_id" data-rule="required" data-source="class/attr/index" class="form-control selectpage form-control" name="row[class_attr_id]" type="text" value="">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Class_attr_names')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-class_attr_names" data-rule="required" class="form-control form-control" name="row[class_attr_names]" type="text" value="">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Classes_id')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-classes_id" data-rule="required" data-source="classes/index" class="form-control selectpage form-control" name="row[classes_id]" type="text" value="">
        </div>
    </div>-->
    <div class="form-group" >
        <label class="control-label col-xs-12 col-sm-2">{:__('Sp_value_name')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-sp_value_name" data-rule="required" class="form-control form-control" name="row[sp_value_name][]" type="text" value="">
        </div>
    </div>
    <div class="form-group" id="addSpec">
        <label class="control-label col-xs-12 col-sm-2"></label>
        <div class="col-xs-12 col-sm-8">
            <button type="button" class="btn btn-success btn-embossed" id="btnAddSpec">{:__('增加')}</button>
        </div>
    </div>
    <!--<div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Deletetime')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-deletetime" class="form-control datetimepicker form-control" data-date-format="YYYY-MM-DD HH:mm:ss" data-use-current="true" name="row[deletetime]" type="text" value="{:date('Y-m-d H:i:s')}">
        </div>
    </div>-->
    <div class="form-group layer-footer">
        <label class="control-label col-xs-12 col-sm-2"></label>
        <div class="col-xs-12 col-sm-8">
            <button type="submit" class="btn btn-success btn-embossed disabled">{:__('OK')}</button>
            <button type="reset" class="btn btn-default btn-embossed">{:__('Reset')}</button>
        </div>
    </div>
</form>

<script>

    $(function(){

        $("#btnAddSpec").click(function(){
           // alert(111);
            var str=' <div class="form-group">'+
                '<label class="control-label col-xs-12 col-sm-2">规格值名称:</label>'+
                '<div class="col-xs-12 col-sm-8">'+
                '<input id="c-sp_value_name" data-rule="required" class="form-control form-control" name="row[sp_value_name][]" type="text" value="">'+
                '</div>'+
                '</div>';
                $('#addSpec').before(str);
        })
    })

</script>